<template>
  <div class="flex-box">
    <div class="flex-left">
      <div class="flex-header">
        <img src="@/assets/common/icon-flex-1.png" class="icon" alt="" />
        <div class="flex-title">实时测量数据</div>
      </div>
      <div class="flex-body">
        <div class="sidler-grid">
          <div class="grid-item" v-for="(item, index) in paramers" :key="index">
            <div class="item-value">{{ item.value }}</div>
            <div class="item-title">{{ item.name }}</div>
          </div>
        </div>
      </div>
    </div>
    <div class="flex-right">
      <div class="flex-header">
        <img src="@/assets/common/icon-flex-2.png" class="icon" alt="" />
        <div class="flex-title">光谱图显示</div>
      </div>
      <div class="flex-body">
        <div class="zone-box">
          <div class="zone-content">
            <img class="zone-icon" src="@/assets/common/zone-img.png" />
            <div class="zone-text">实时光谱曲线显示区域</div>
            <div class="zone-loading"><a-spin /> <span>数据更新中…</span></div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script setup lang="ts">
import { ref } from "vue";
const paramers = ref([
  {
    name: "输入波长(nm)",
    value: 550,
  },
  {
    name: "输入波长(nm)",
    value: 550,
  },
  {
    name: "输入波长(nm)",
    value: 550,
  },
  {
    name: "输入波长(nm)",
    value: 550,
  },
]);
</script>
<style lang="less" scoped>
.flex-box {
  display: flex;
  padding: 16px 0;
  justify-content: space-between;
  .flex-left {
    width: 368px;
    height: 553px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e6ebf1;
  }
  .flex-right {
    width: 768px;
    height: 553px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e6ebf1;
  }
}
.flex-header {
  display: flex;
  align-items: center;
  background: #f2f3f5;
  padding: 0 12px;
  height: 42px;
  .icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
  }
  .flex-title {
    font-family: PingFangSC, PingFang SC;
    font-weight: 500;
    font-size: 16px;
    color: #262626;
    line-height: 22px;
    text-align: left;
    font-style: normal;
  }
}
.flex-body {
  padding: 16px;
}
.sidler-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding-top: 12px;
  .grid-item {
    width: 160px;
    height: 90px;
    background: #f2f3f5;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    .item-value {
      font-family: PingFangSC, PingFang SC;
      font-weight: 600;
      font-size: 20px;
      color: #262626;
      line-height: 26px;
      text-align: center;
      font-style: normal;
      margin-bottom: 4px;
    }
    .item-title {
      font-family: PingFangSC, PingFang SC;
      font-weight: 400;
      font-size: 12px;
      color: #595959;
      line-height: 16px;
      text-align: center;
      font-style: normal;
    }
    &:nth-child(2n + 1) {
      &::after {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        content: "";
        width: 1px;
        height: 16px;
        background: #e6ebf1;
      }
    }
  }
}
.zone-box {
  width: 733px;
  height: 461px;
  background: #fbfbfb;
  border-radius: 8px;
  border: 1px dashed #bec4ca;
  display: flex;
  align-items: center;
  justify-content: center;
  .zone-content {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    .zone-icon {
      width: 72px;
      height: 72px;
       //旋转动画
      // animation: rotation 2s linear infinite;
      // @keyframes rotation {
      //   from {
      //     transform: rotate(0deg);
      //   }
      //   to {
      //     transform: rotate(360deg);
      //   }
      // }
    }
    .zone-text {
      padding: 8px 0;
      font-family: PingFangSC, PingFang SC;
      font-weight: 500;
      font-size: 16px;
      color: #262626;
      line-height: 22px;
      text-align: left;
      font-style: normal;
    }
    .zone-loading {
      display: flex;
      align-items: center;
      font-family: PingFangSC, PingFang SC;
      font-weight: 400;
      font-size: 12px;
      color: #2776ff;
      line-height: 16px;
      text-align: left;
      font-style: normal;
      span{
        margin-left: 5px;
      }
    }
  }
}
</style>
